#ifndef __BOTTOM_SUCKER_BLOCK_H__
#define __BOTTOM_SUCKER_BLOCK_H__

#include "WaterBlock.h"

namespace PocketSurvival
{
    class SubsystemTerrain;

    class BottomSuckerBlock : public WaterBlock
    {
    private:
        SubsystemTerrain *subsystemTerrain;
    public:
		BottomSuckerBlock();
        virtual void initialize() override;
        virtual BlockPlacementData getPlacementValue(ComponentMiner *componentMiner, int32_t value, const TerrainRaycastResult &raycastResult) override;

		static inline int32_t GetFace(int32_t data);
		static inline int32_t SetFace(int32_t data, int32_t face);
		static inline int32_t GetSubvariant(int32_t data);
		static inline int32_t SetSubvariant(int32_t data, int32_t face);
    };

	int32_t BottomSuckerBlock::GetFace(int32_t data)
	{
		return (data >> 8) & 7;
	}

	int32_t BottomSuckerBlock::SetFace(int32_t data, int32_t face)
	{
		return (data & -1793) | ((face & 7) << 8);
	}

	int32_t BottomSuckerBlock::GetSubvariant(int32_t data)
	{
		return (data >> 11) & 3;
	}

	int32_t BottomSuckerBlock::SetSubvariant(int32_t data, int32_t face)
	{
		return (data & -6145) | ((face & 3) << 11);
	}

} // namespace PocketSurvival


#endif
